package com.baor.controller;

import com.baor.service.AppletService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping ("/applet")
public class AppletController {

    @Autowired
    private AppletService appletService;

    @RequestMapping ("/channelAgent")
    public AjaxResult<?> channelAgent(@RequestParam int userId) {
        return appletService.channelAgent(userId);
    }

    @RequestMapping("/examine")
    public AjaxResult<?> examine(@RequestBody Map<String,Object> param) {
        return appletService.examine(param);
    }

    @RequestMapping("/reward")
    public AjaxResult<?> reward(@RequestParam int userId) {
        return appletService.reward(userId);
    }

    @RequestMapping("/click")
    public AjaxResult<?> click(@RequestParam int userId) {
        return appletService.click(userId);
    }

    @RequestMapping("/registIf")
    public AjaxResult<?> registIf(@RequestParam int userId) {
        return appletService.registIf(userId);
    }

    @RequestMapping("/check")
    public AjaxResult<?> check(@RequestParam int userId) {
        return appletService.check(userId);
    }

    @RequestMapping("/checkConf")
    public AjaxResult<?> checkConf(@RequestParam int siteId) {
        return appletService.checkConf(siteId);
    }

}
